function main() {
    // 验证用户权限
    'use api/user/acl/excerpt.js'

    let tableId = payload.get().path.split('/').pop()
    let newTableId = ex.suid().base58()
    let query = `INSERT INTO dm_tables (table_id, table_name, table_comment, class_name, module_name, business_name, function_name, function_author, pk_column,  pk_field_name, proprietor_id, proprietor_name) SELECT ?, table_name, table_comment, class_name, module_name, business_name, function_name, function_author, pk_column,  pk_field_name, proprietor_id, proprietor_name FROM dm_tables WHERE table_id =?`
    let res = SQL.exec('system_sql', query, newTableId, tableId)
    if (!res) {
        return errMsg(507, '创建表信息失败')
    }
    query = `SELECT column_id FROM dm_table_columns WHERE table_id =?`;
    res = SQL.query('system_sql', query, tableId)
    let newColumnId

    res.forEach((columnId) => {
        newColumnId = ex.suid().base58()
        query = `INSERT INTO dm_table_columns (column_id, table_id, sort, table_name, column_name, column_comment, column_type, column_key, field_name, is_pk, is_required, is_increment, html_type, proprietor_id, proprietor_name) SELECT ?, table_id, sort, table_name, column_name, column_comment, column_type, column_key, field_name, is_pk, is_required, is_increment, html_type, proprietor_id, proprietor_name FROM dm_table_columns WHERE column_id =?`
        SQL.push('system_sql', query, newColumnId, columnId)
    })

    return okMsg(newTableId)

}